home *** CD-ROM | disk | FTP | other *** search
- Path: atglab.bls.com!Alun.Champion
- From: Alun.Champion@bridge.bst.bls.com (Alun Champion)
- Newsgroups: comp.lang.c
- Subject: Re: Bit Masking
- Date: 10 Jan 1996 22:11:01 GMT
- Organization: Computer People Inc.
- Message-ID: <ALUN.CHAMPION.96Jan10171101@g7240065.bridge.bst.bls.com>
- References: <DKz5y4.8En@twisto.eng.hou.compaq.com>
- NNTP-Posting-Host: bstfirewall.bst.bls.com
- In-reply-to: garyc%cs%contractors@bangate.compaq.com's message of Wed, 10 Jan
- 1996 17:06:24 GMT
-
- In article <DKz5y4.8En@twisto.eng.hou.compaq.com> garyc%cs%contractors@bangate.compaq.com (Gary Clarke) writes:
-
- : Can someone tell me the elegent way to clear specific bits from a
- : byte, e.g.
-
- : # define BIT_1 1
- : # define BIT_2 2
- : # define BIT_3 4
- : # define BIT_4 8
-
- : Set the bit: x |= BIT_x
-
- : Clear the bit using BIT_x: ????
-
- Clear the bit: x &= ~BIT_?;
-
- Regards
-
- -A.
- --
- | A.Champion |
-